home *** CD-ROM | disk | FTP | other *** search
- /* wintest.c - A Windows test CSUB */
-
- /* This routine prints a string and two numbers to a Windows message
- * box and halts until the user clicks the mouse pointer in the OK
- * part of the message box.
- */
-
- #include <windows.h>
- #include <stdio.h> /* for sprintf() */
- #include "csubw.h"
-
- int wintest(
- int npar, /* no. arguments */
- strptr msg, /* string part of message */
- dimptr msgdim,
- realptr rval, /* real value */
- intptr ival) /* integer value */
- {
- char buf[72];
- char tmp[48];
- int len;
-
- len = (int)msg->clen; /* length of input string */
- if (len > 24) /* max. 24 */
- len = 24;
- memcpy(buf, msg->str, len); /* move to buffer */
- buf[len] = '\0'; /* NUL-terminate */
- sprintf(tmp, " Real value: %6.2f, Integer value: %4d\n", *rval, (int)*ival);
- strcat(buf, tmp); /* add numeric values */
- MessageBox(NULL, buf, "TEST CSUB", MB_ICONEXCLAMATION|MB_OK|MB_SYSTEMMODAL ); /* output */
- return (0);
- }